home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1999 Macromedia, Inc. All rights reserved.
-
- //*************** GLOBALS VARS *****************
-
- var HELP_DOC = HELP_cmdNameEditor;
-
- var THE_NAME = '';
- var IS_SET = false;
- var HANDLE_EXT = false;
-
-
- //******************* API **********************
-
- function commandButtons(){
- return new Array(BTN_OK,"cmdOK()",
- BTN_Cancel,"cmdCancel()",
- BTN_Help,"displayHelp()");
- }
-
- function cmdOK() {
- if (applyCommand()) {
- garbageCollect(true);
- window.close();
- }
- }
-
- function cmdCancel() {
- garbageCollect(true);
- window.close();
- }
-
- function applyCommand() {
- if (THE_NAME) {
- IS_SET = true;
- return true;
- } else {
- alert(MSG_enterName);
- return false;
- }
- }
-
- function inspectCommand(theName, isCondOrSeg){
- THE_NAME = theName;
- IS_SET = false;
- HANDLE_EXT = isCondOrSeg;
- }
-
- //***************** LOCAL FUNCTIONS ******************
-
- function initializeUI(){
- var theObj;
-
- theObj=findObject('theName');
- if (HANDLE_EXT && theObj)
- theObj.value = removeExt(THE_NAME);
- else
- theObj.value = THE_NAME;
-
- document.theForm.theName.focus();
- document.theForm.theName.select();
- }
-
- function updateUI(theItemName) {
- var theObj;
-
- theObj = findObject(theItemName);
- if (theObj) {
- if (theItemName == 'theName' &&
- (!HANDLE_EXT || removeExt(THE_NAME) != theObj.value) ) {
- THE_NAME = theObj.value;
- THE_NAME = replaceSub(THE_NAME, '"', '');
- THE_NAME = replaceSub(THE_NAME, "'", '');
- theObj.value = THE_NAME;
- }
- }
- }
-
-